This folder includes replication data and code files for Bas & Stone "Probabilistic Democracy" 

All analyses below are conducted in Stata 18.0, except the two 3-D figures that are produced in R (Figures 3 and 10b). 

Note: when you run various replication codes, do not manually save over the data files, as some of them are needed for other results as well

Before starting, set the working directory in Stata to this replication folder in your computer: BasStoneISQ 


*** Main Paper Tables and Figures***

1. Reproducing Figure 2 requires Monte Carlo simulations that will take about 2-3 hours. The relevant files are:
- this is the simulation code: MC_Code_Fig2.do 
- the resulting simulation data set: MonteCarlo_N2000_I10000.dta
- code that generates Figure 2: Figure2.do 
- log files for Figure 2 and MC code are Figure2.smcl and MC_Code.smcl
 
2. To reproduce Table 1 (main regression results), use the following data and code in the replication folder:
- replication data: BasStoneReplication.dta
- code for the table: Table1Replication.do
- log file: Table1.smcl

3. To reproduce Table 2 (substantive effects), use the following data and code in the replication folder:
- replication data: BasStoneReplication.dta
- code for the table: Table2Replication.do
- log file: Table2.smcl

4. The 3-D figure on Ethiopia is generated in R. Here are the relevant files:
- code: Fig3_PerspNonMon.R
- log file: Figure3.Rhistory

5. To reproduce Figure 4 (waves of Democracy),
- data file: Figure4data.dta
- Stata code: Figure4.do
- log file: Figure4.smcl 

6. To reproduce Figures 5 and 6 (Japan and India), you need
- data file: Figures5and6Data.dta
- code: Figures5and6.do
- log: Figures5and6.scml


***Appendix Tables and Figures***

7. Appendix Figure 7 (out of sample predictions) uses
- BasStoneReplication.dta
- AppendixFigure7.do
- AppendixFigure7.smcl

8. Appendix Figure 8 (out of sample predictions histogram) uses
- BasStoneReplication.dta
- Figure8simul.do
- AppendixFigure8.smcl

9. Appendix Figure 9 (out of sample Cold War comparisons) needs
- BasStoneReplication.dta
- Figure9code.do
- Figure9.smcl

10. For Appendix Figure 10a, 
- MeasureComparisons.dta
- Figure10a_DGPfor10b
- Figure10a.smcl


11. Appendix Figure 10b is generated in R. You'll need 
- DataforFigure10b.csv
- Figure10b.R
- Figure10b.Rhistory


12. Appendix Table 3 (Factor analysis) uses
- MeasureComparisons.dta
- Table3.do
- Table3.smcl


13. Appendix Table 4 uses
- BasStoneReplication.dta
- AppendixTable4.do
-AppendixTable4.smcl





